package com.wind.base;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.debug.soblogin.R;
import com.xuexiang.xupdate.XUpdate;

import java.util.Objects;


/**
 * @author lolxiaoguo.com
 * @version $Rev$
 * on 2020/7/12
 */
public abstract class BaseFragment extends Fragment {


    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {


        View rootView = loadRootView(inflater, container);

        //初始化控件
        initView(rootView);
        initData();
        initListener();
        return rootView;

    }

    protected  void initData(){

    }

    /**
     * 如果子类需要监听事件，复写此方法
     */

    protected void initListener() {


    }

    protected View loadRootView(LayoutInflater inflater, ViewGroup container) {

        return inflater.inflate(R.layout.base_fragment_layout, container, false);
    }


    protected void initView(View rootView) {

    }

}
